package exp.day01;

public class P03_DigGraphics {
    static int n = 3;

    public static void main(String[] args) {
        //上半部分
        for (int i = 1; i <= n; i++) {          //打印行数
            for (int j = 1; j <= n - i; j++) {
                System.out.print(" ");        //打印每行的空格数
            }
            for (int k = 1; k <= i; k++) {      //打印1~i
                System.out.print(k);
            }
            for (int m = i - 1; m > 0; m--) {     //打印i-1~1
                System.out.print(m);
            }
            System.out.println();           //输出换行
        }
        //下半部分
        for (int i = n-1; i >= 1; i--) {
            for (int j = n - i; j >= 1; j--) {
                System.out.print(" ");
            }
            for (int m = 1; m <= i - 1; m++) {
                System.out.print(m);
            }
            for (int k = i; k >= 1; k--) {
                System.out.print(k);
            }
            System.out.println();
        }
    }
}
